home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / fgl105c.zip / 05-08.C < prev    next >
Text File  |  1991-05-05  |  630b  |  37 lines

  1. #define COLORS 16
  2. #define WIDTH  40
  3.  
  4. main()
  5.  
  6. {
  7.    int base;
  8.    int color;
  9.    int minx, maxx;
  10.    int mode;
  11.  
  12.    mode = fg_getmode();
  13.    fg_setmode(16);
  14.  
  15.    base = 0;
  16.    minx = 0;
  17.    maxx = WIDTH - 1;
  18.  
  19.    for (color = 0; color < COLORS; color++) {
  20.       fg_palette(color,0);
  21.       fg_setcolor(color);
  22.       fg_rect(minx,maxx,0,349);
  23.       minx = maxx + 1;
  24.       maxx = maxx + WIDTH;
  25.       }
  26.  
  27.    while (base < COLORS*4) {
  28.       for (color = 0; color < COLORS; color++)
  29.          fg_palette(color,base+color);
  30.       base += COLORS;
  31.       fg_waitkey();
  32.       }
  33.  
  34.    fg_setmode(mode);
  35.    fg_reset();
  36. }
  37.